#include<iostream>
using namespace std;


class A {
public:
	friend class B;
	A(int n=0) {
		m_n = n;
	}
private:
	int m_n;
	void setN(int n) {
		m_n = n;
	}
};

class B {
public:
	void setA_n(int n) {
		a.m_n = n;
	}
	void print() {
		cout << a.m_n << endl;
	}
private:
	A a;
};


int main() {
	B b;
	b.setA_n(3);
	b.print();
	system("pause");
	return 0;
}